<?
	if($_POST['adminName']&&$_POST['adminPwd']){
		include_once(dirname(__FILE__)."/../function/login.php");
		$result = login($_POST['adminName'],$_POST['adminPwd'],$db);
		
		if($result) {
			@setcookie("snadminName",$_POST['adminName'],time()+3600);
			@setcookie("snadminPwd" ,$_POST['adminPwd'] ,time()+3600);
			include_once(dirname(__FILE__)."/mastpage.php");
		}
		else {
			$back = 1;
			include_once(dirname(__FILE__)."/../view/login.php");
		}
	}
	else {
		include_once(dirname(__FILE__)."/../view/login.php");
	}